import React from 'react';
import {messages} from "share/common";
import {Row, Table} from 'antd'
import ShowInfo from '../show-info'

const AircrewInfo = ({data}) => {
  const hrLine = {
    border: '0.5px solid #e8e8e8',
    marginBottom: 14,
  }
  const ticketInfoColumns = [
    {title: messages('supplier.key514')/*航班编号*/, dataIndex: 'sa', key: 'sa'},
    {title: messages('supplier.key515')/*编号*/, dataIndex: 'code', key: 'code'},
    {title: messages('supplier.key516')/*机票使用状态代码*/, dataIndex: 'code1', key: 'code1'},
    {title: messages('supplier.key517')/*机票使用状态名称*/, dataIndex: 'name', key: 'name'},
  ]

  const info = [
    {title: messages('supplier.key518')/*航程编号*/, dataIndex: 'sequence', key: 'sequence'},
    {title: messages('supplier.key519')/*保险数量*/, dataIndex: 'insuaranceQuantity', key: 'insuaranceQuantity'},
    {title: messages('supplier.key520')/*保险单价*/, dataIndex: 'insuaranceUnitPrice', key: 'insuaranceUnitPrice'},
    {title: messages('supplier.key521')/*保险状态*/, dataIndex: 'insuranceStatus', key: 'insuranceStatus'},
    {title: messages('supplier.key522')/*保单状态描述*/, dataIndex: 'insuranceStatusDec', key: 'insuranceStatusDec'},
    {title: messages('supplier.key523')/*保险类型*/, dataIndex: 'ad', key: 'ad'},
    {title: messages('supplier.key524')/*保险类型名称*/, dataIndex: 'insuranceType', key: 'insuranceType'},
    {title: messages('supplier.key525')/*保单号*/, dataIndex: 'insuranceNo', key: 'insuranceNo'},
    {title: messages('supplier.key526')/*保险编号*/, dataIndex: 'typeIds', key: 'typeIds'},
    {title: messages('supplier.key527')/*保险公司名称*/, dataIndex: 'insuaranceCompanyName', key: 'insuaranceCompanyName'},
    {title: messages('supplier.key528')/*是否绑定*/, dataIndex: 'aff', key: 'aff'},
    {title: messages('supplier.key529')/*预订保险数量*/, dataIndex: 'insuaranceNumBook', key: 'insuaranceNumBook'},
  ]

  return (
    <div>
      {
        data.map(data => {
          return (
            <div>
              <h3 style={{marginLeft: 24}}>{messages('supplier.key312')/*乘机人*/}</h3>
              <hr style={{border: '0.5px solid #e8e8e8'}}/>
              <div style={{padding: '12px 24px'}}>
                <h4>{messages('supplier.key313')/*乘客基本信息*/}</h4>
                <Row>
                  <ShowInfo label={messages('supplier.key314')/*乘机人工号*/} value={data.corpEid}/>
                  <ShowInfo label={messages('supplier.key315')/*乘机人姓名*/} value={data.passengerName}/>
                  <ShowInfo label={messages('supplier.key316')/*乘机人姓名拼音*/} value={data.passengerNamePy}/>
                  <ShowInfo label={messages('supplier.key317')/*国籍代码*/} value={data.nationalityCode}/>
                  <ShowInfo label={messages('supplier.key318')/*国籍名称*/} value={data.nationalityName}/>
                  <ShowInfo label={messages('supplier.key319')/*证件种类名称*/} value={data.cardTypeName}/>
                  <ShowInfo label={messages('supplier.key320')/*证件号码*/} value={data.cardTypeNumber}/>
                  <ShowInfo label={messages('supplier.key321')/*性别*/} value={data.gender}/>
                  <ShowInfo label={messages('supplier.key322')/*生日*/} value={data.birthday}/>
                </Row>
                {/*<hr style={hrLine}/>*/}
                {/*<h4>{messages('supplier.key530')}</h4>*/}
                {/*<Table*/}
                  {/*bordered*/}
                  {/*columns={ticketInfoColumns}*/}
                  {/*dataSource={data.airInsurance || []}*/}
                {/*/>*/}
                <hr style={hrLine}/>
                <h4>{messages('supplier.key531')/*保险信息*/}</h4>
                <Table
                bordered
                columns={info}
                dataSource={data.airInsurance || []}
                scroll={{x: true}}
                />
              </div>
            </div>
          )
        })
      }
    </div>
  )

}

export default AircrewInfo;
